#ifndef QPROPERTYFORMWIDGET_P_H
#define QPROPERTYFORMWIDGET_P_H

// ONLY INCLUDE THIS IN .CPP FILES

#include <QList>
#include "QProperty.h"

namespace QPE {

class QPropertyFormWidgetPrivate {
public:
	//! Stores either another QPropertyFormWidget (then Editor is null) or an editor widget (then FormWidget is null)
	struct SEditorWidget {
		SEditorWidget() : FormWidget(NULL), Editor(NULL) {}
		SEditorWidget(QPropertyFormWidget* form_widget) : FormWidget(form_widget), Editor(NULL) {}
		SEditorWidget(QWidget* editor_widget) : FormWidget(NULL), Editor(editor_widget) {}

		QPropertyFormWidget* FormWidget;
		QWidget* Editor;
	};

	//! The root property to use
	QList<QProperty*> Properties;

	//! Binds the properties to their editors
	QList<SEditorWidget> EditorWidgets;

	//! Determines the behaviour of the editors. If this is true, when a focus out event etc. happens, the data will be submitted to the QProperty. If false, you will have to call commitData() yourself.
	bool UpdateEditors;

	//! Default constructor
	QPropertyFormWidgetPrivate()
		: UpdateEditors(true)
	{}

	//! Constructor
	QPropertyFormWidgetPrivate(const QList<QProperty*>& properties)
		: Properties(properties), UpdateEditors(true) {}
};

}

#endif // QPROPERTYFORMWIDGET_P_H
